import { _decorator, Button, Component, Label, log, macro, Node } from 'cc';
import { ref } from '@vue/reactivity';
import { BaseView } from '../../../framework/ui/BaseView';
import { uibind } from '../../../framework/ui/UIDecorator';
import { ViewShowType } from '../../../framework/ui/ViewShowType';
import { ViewLayerDefine } from '../../../framework/ui/VewLayerDefine';
import { UIMgr } from '../../../framework/ui/UIMgr';
import ViewDefine from '../ViewDefine';

const { ccclass, property } = _decorator;

@ccclass('MainView')
export class MainView extends BaseView {

    @uibind("+funcs/+menu",Button)
    private funcMenu:Button;
    @uibind("+funcs/+heros",Button)
    private funcHeros:Button;
    @uibind("+funcs/+bag",Button)
    private funcBag:Button;
    @uibind("+funcs/+mall",Button)
    private funcMall:Button;
    @uibind("+battle_btn",Button)
    private battleBtn:Button;
    //home
    //卡组
    //战役
    //副本
    constructor() {
        super();
        this.showType = ViewShowType.ALONE;
        this.layer = ViewLayerDefine.Main;
    }

    public init(): void {
        this.funcMenu.node.on(Button.EventType.CLICK, ()=>UIMgr.Ins.show(ViewDefine.MenusView), this);
        this.funcHeros.node.on(Button.EventType.CLICK, ()=>UIMgr.Ins.show(ViewDefine.HerosView), this);
        this.funcBag.node.on(Button.EventType.CLICK, ()=>UIMgr.Ins.show(ViewDefine.BagView), this);
        this.funcMall.node.on(Button.EventType.CLICK, ()=>UIMgr.Ins.show(ViewDefine.MallView), this);
        this.battleBtn.node.on(Button.EventType.CLICK, ()=>UIMgr.Ins.show(ViewDefine.MallView), this);
    }


}


